package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * @author liyang
 * @version 1.0
 * @package io
 * @file WriteStringDemo.java
 * @description
 * @time 2024-03-20 23:50
 */
public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("demo.txt");
        String line = "靠恁姨";

        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        //System.out.println(data);
        fos.write(data);

        System.out.println("创作完毕");
        fos.close();
    }
}
